* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #1e88e5;
    --primary-dark: #1565c0;
    --secondary: #26a69a;
    --accent: #ff7043;
    --light: #f5f5f5;
    --dark: #263238;
    --success: #43a047;
    --warning: #ff9800;
    --danger: #e53935;
    --gray: #78909c;
    --border: #e0e0e0;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --sidebar-width: 280px;
    --header-height: 60px;
}

body {
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    transition: all 0.3s;
    overflow-y: auto;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-left: 10px;
}

.logo img {
    width: 36px;
    height: 36px;
}

.accordion-menu {
    padding: 15px 0;
}

.menu-item {
    list-style: none;
}

.menu-item.has-submenu > a {
    position: relative;
}

.menu-item.has-submenu > a:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

.menu-item.has-submenu.open > a:after {
    transform: translateY(-50%) rotate(180deg);
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.menu-item a:hover,
.menu-item a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item i {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
}

.menu-item.open .submenu {
    max-height: 500px;
}

.submenu-item a {
    padding-left: 55px;
    font-size: 0.95rem;
}

.submenu-item a.active {
    background: var(--primary);
    color: white;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px 0; /* 修改此行，将左右padding改为0 */
    transition: margin-left 0.3s;
    width: calc(100% - var(--sidebar-width)); /* 添加此行确保内容区宽度正确计算 */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.header h2 {
    font-size: 1.8rem;
    color: var(--dark);
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
}

.user-dropdown {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.user-avatar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

.user-avatar i {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

.dropdown-menu i {
    margin-right: 8px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: extrem;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* 调整表格容器 */
.table-container {
    overflow-x: auto;
    margin: -10px;
    padding: 10px;
}

/* 优化表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 15px 12px; /* 增加垂直内边距，减少水平内边距 */
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap; /* 防止文本换行 */
    vertical-align: middle;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 调整列宽 */
th:nth-child(1), td:nth-child(1) { /* 车次ID */
    width: 80px;
    text-align: center;
}

th:nth-child(2), td:nth-child(2) { /* 车次号 */
    width: 100px;
    font-weight: 500;
}

th:nth-child(3), td:nth-child(3), /* 始发站 */
th:nth-child(4), td:nth-child(4) { /* 终点站 */
    width: 120px;
}

th:nth-child(5), td:nth-child(5) { /* 经停站数 */
    width: 80px;
    text-align: center;
}

th:nth-child(6), td:nth-child(6) { /* 状态 */
    width: 80px;
    text-align: center;
}

th:nth-child(7), td:nth-child(7), /* 发车时间 */
th:nth-child(8), td:nth-child(8), /* 到站时间 */
th:nth-child(9), td:nth-child(9) { /* 创建时间 */
    width: 160px;
}

/* 优化操作按钮区域 */
/* 横向排列按钮布局 */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    flex: 1;
}

.action-btn {
    min-width: 70px;
    padding: 4px 6px !important;
    font-size: 0.75rem !important;
    flex: 1;
    max-width: 90px;
}

th:nth-child(10), td:nth-child(10) { /* 操作 */
    width: 320px; /* 增加宽度以适应横向排列的按钮 */
    text-align: center;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-btn {
        width: 100%;
        max-width: 120px;
        margin-bottom: 2px;
    }

    th:nth-child(10), td:nth-child(10) {
        width: 200px;
    }
}
.button-row {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.action-btn {
    min-width: 80px;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    flex: 1;
    max-width: 100px;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .button-row {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 120px;
        margin-bottom: 2px;
    }
}
.action-btn i {
    margin-right: 2px;
    font-size: 0.75rem;
}

/* 优化表格行悬停效果 */
tr:hover {
    background-color: #f8f9fa;
    transform: translateY(0);
    transition: background-color 0.2s;
}

/* 优化日期时间显示 */
.datetime-cell {
    font-family: monospace;
    font-size: 0.85rem;
}

/* 调整分页区域 */
.pagination {
    margin-top: 25px !important;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.page-info {
    font-size: 0.9rem;
    color: var(--gray);
}

/* 响应式优化 */
/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

/* 确保在响应式布局下按钮组仍然正常显示 */
@media (max-width: 1200px) {
    .action-buttons {
        display: grid;
        flex-direction: column;
        align-items: center;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 120px;
        margin-bottom: 2px;
    }
}

    th:nth-child(10), td:nth-child(10) {
        width: 100px;
    }


@media (max-width: 992px) {
    th, td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    .card-body {
        padding: 15px;
    }
}

/* 改善卡片样式 */
.card {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.card-body {
    padding: 20px;
}

/* 状态标签优化 */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-secondary {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* 新增红色异常标签样式 */
.badge-danger {
    background-color: var(--danger);
    color: white;
}

.btn {
    padding: 8px 15px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: extrem;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-ban {
    background: lightskyblue;
    color: white;  /* 将文字颜色改为白色以确保在浅蓝色背景上清晰可见 */
    border: none;  /* 移除边框线 */
}

.btn-ban:hover {
    background: skyblue;  /* 鼠标悬停时稍微加深颜色 */
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control2 {
    width: 300px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;

    font-size: 1rem;
    margin-left: 10px;

}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0  15px;
    width: 100%;
}



.col-6 {
    flex: 0 0 50%;
    padding: 0 10px;
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .logo h1, .menu-item span {
        display: none;
    }

    .menu-item i {
        margin-right: 0;
        font-size: 1.5rem;
    }

    .menu-item.has-submenu > a:after {
        display: none;
    }

    .submenu {
        display: none;
    }

    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 20px;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }

    .sidebar.collapsed {
        width: 0;
        overflow: hidden;
    }

    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }
}

/*.page-content {*/
/*    display: none;*/
/*}*/

.page-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

/* 修改经停站按钮默认颜色为蓝绿色 */
.action-btn.station-btn {
    background-color: #00acc1 !important; /* 蓝绿色，Material Design中的teal-500 */
    color: white !important;
    border-color: #00acc1 !important;
}

/* 保持按钮悬停效果 */
.action-btn.station-btn:hover {
    background-color: #00897b !important; /* 深一些的蓝绿色 */
    border-color: #00897b !important;
}

/* 保持按钮激活状态不变 */
.action-btn.station-btn:active {
    background-color: #00695c !important;
    border-color: #00695c !important;
}


.train-info-display {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.info-item {
    display: flex;
    align-items: center;
    flex: 1;
}

.info-icon {
    background: #1e88e5;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
}

.info-content {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 2px;
}

.info-value {
    font-size: 16px;
    color: #212529;
    font-weight: 600;
}

.separator {
    color: #adb5bd;
    margin: 0 20px;
    font-size: 18px;
    font-weight: 300;
}

/* 悬停效果 */
.info-item:hover .info-icon {
    background: #1565c0;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .train-info-display {
        flex-direction: column;
        gap: 15px;
    }

    .info-item {
        width: 100%;
        justify-content: flex-start;
    }

    .separator {
        display: none;
    }
}
/*-----------*/
.horizontal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.card-icon {
    background: #1e88e5;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.card-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.status-tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-normal {
    background: #28a745;
    color: white;
}

.status-abnormal {
    background: #dc3545;
    color: white;
}

/* 权限管理模态框美化样式 */
.permission-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.permission-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.permission-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.permission-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.permission-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.permission-modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.permission-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 权限树美化样式 */
.permission-tree {
    font-size: 14px;
}

.permission-tree ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.permission-tree > ul {
    padding-left: 0;
}

.permission-tree li {
    margin-bottom: 8px;
    padding: 6px 0;
}

.permission-tree li.menu-item {
    font-weight: 500;
    margin-top: 12px;
    position: relative;
}

.permission-tree li.menu-item:first-child {
    margin-top: 0;
}

.permission-tree li.sub-menu-item {
    padding-left: 30px;
    font-weight: normal;
}

.permission-tree li.sub-menu-item:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 美化复选框 */
.permission-tree input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.permission-tree label {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 100%;
}

.permission-tree label:hover {
    background-color: #f0f2f5;
}

.permission-tree label.active {
    background-color: #e3f2fd;
    border-left: 3px solid var(--primary);
}


/* 美化图标 */
.page-icon {
    margin-right: 8px;
    min-width: 20px;
    text-align: center;
}

.page-icon.fa-folder {
    color: #ffb300;
}

.page-icon.fa-file {
    color: #4285f4;
}

/* 权限搜索框样式 */
.permission-search {
    margin-bottom: 20px;
    position: relative;
}

.permission-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.permission-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.permission-search::before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 角色信息显示 */
.role-info {
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.role-info strong {
    color: var(--primary);
}

/* 全选/取消全选按钮 */
.permission-actions {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.permission-actions button {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .permission-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .permission-modal-header,
    .permission-modal-body,
    .permission-modal-footer {
        padding: 16px;
    }

    .permission-actions {
        flex-direction: column;
    }

    .permission-actions button {
        width: 100%;
    }
}

/* 权限树的展开/折叠功能美化 */
.permission-tree .expand-icon {
    margin-right: 8px;
    cursor: pointer;
    font-size: 10px;
    transition: transform 0.2s ease;
    min-width: 16px;
    text-align: center;
}

.permission-tree .expand-icon.expanded {
    transform: rotate(90deg);
}

/* 滚动条美化 */
.permission-modal-body::-webkit-scrollbar {
    width: 6px;
}

.permission-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.permission-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.permission-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


